package de.jmda.core.mproc.task;

import org.apache.log4j.Logger;

import de.jmda.core.mproc.Processor;

public abstract class AbstractTaskProcessor
    extends Processor
{
	private final static Logger LOGGER =
			Logger.getLogger(AbstractTaskProcessor.class);

	protected Task task;

	public AbstractTaskProcessor(Task task)
  {
	  super();
	  this.task = task;
  }

	@Override
	protected boolean process()
	{
		try
    {
	    return task.execute();
    }
    catch (TaskException e)
    {
    	LOGGER.error("failure during task execution", e);
    }

		return false;
	}
}